﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
	<Style x:Key="PasswordBoxStyle" TargetType="PasswordBox">
		<Setter Property="BorderThickness" Value="1" />
		<Setter Property="Background" Value="{DynamicResource White}" />
		<Setter Property="BorderBrush" Value="#FFABADB3" />
		<Setter Property="SelectionBrush" Value="#FF909090" />
		<Setter Property="SelectionOpacity" Value="0.5" />
		<Setter Property="Foreground" Value="{DynamicResource Black}" />
		<Setter Property="ContextMenu">
			<Setter.Value>
				<ContextMenu>
					<MenuItem Header="_Paste" Command="ApplicationCommands.Paste" InputGestureText="Ctrl+V">
						<MenuItem.Icon>
							<Image Source="pack://application:,,,/Daytimer.Images;component/Images/paste_sml.png" />
						</MenuItem.Icon>
					</MenuItem>
					<Separator />
					<MenuItem Header="_Undo" Command="ApplicationCommands.Undo" InputGestureText="Ctrl+Z">
						<MenuItem.Icon>
							<Image Source="pack://application:,,,/Daytimer.Images;component/Images/undo.png" />
						</MenuItem.Icon>
					</MenuItem>
					<MenuItem Header="_Redo" Command="ApplicationCommands.Redo" InputGestureText="Ctrl+Y">
						<MenuItem.Icon>
							<Image Source="pack://application:,,,/Daytimer.Images;component/Images/redo.png" />
						</MenuItem.Icon>
					</MenuItem>
				</ContextMenu>
			</Setter.Value>
		</Setter>
		<Setter Property="Validation.ErrorTemplate" Value="{x:Null}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type PasswordBox}">
					<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}"
							BorderThickness="{TemplateBinding BorderThickness}"
							Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
						<ScrollViewer x:Name="PART_ContentHost" Focusable="False" HorizontalScrollBarVisibility="Hidden"
								VerticalScrollBarVisibility="Hidden" />
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsEnabled" Value="False">
							<Setter Property="Opacity" TargetName="border" Value="0.56" />
						</Trigger>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter Property="BorderBrush" TargetName="border" Value="#FF7EB4EA" />
						</Trigger>
						<Trigger Property="IsKeyboardFocused" Value="True">
							<Setter Property="BorderBrush" TargetName="border" Value="#FF569DE5" />
						</Trigger>
						<Trigger Property="Validation.HasError" Value="True">
							<Setter Property="BorderBrush" TargetName="border" Value="#FFFF0000" />
							<Setter Property="ToolTip"
									Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style TargetType="PasswordBox" BasedOn="{StaticResource PasswordBoxStyle}">
		<Setter Property="VerticalContentAlignment" Value="Center" />
		<Setter Property="Height" Value="23" />
		<Setter Property="Padding" Value="2,0" />
	</Style>
</ResourceDictionary>